Repository navigation
test(build): shard test_thread_local_destructors over four tests - #26388
Conversation
test_thread_local_destructors runs nm over every test executable in one test, batch after batch, and takes 30.8 s on the Windows CI runner; it grows with every new test. ThreadLocalDestructors.cmake now takes optional SHARD and SHARDS values and checks every SHARDS-th file of the sorted list starting at SHARD. The test keeps its name for shard 0, and test_thread_local_destructors_shard_1 to _3 check the other files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
catminou4
left a comment
There was a problem hiding this comment.
This change is inside if(MINGW) in core/libs/CMakeLists.txt, so test_thread_local_destructors and its shards only exist on the MinGW/Windows build — ctest -N -R thread_local_destructors shows 0 tests on this Linux box, so I could not execute it here.
By inspection the sharding is sound: it round-robins the globbed *.exe modules by sorted index (index % SHARDS), guards bad SHARD/SHARDS with FATAL_ERROR, returns cleanly on an empty shard, and keeps the shard-0 name as test_thread_local_destructors so existing references still resolve while shards 1–3 get _shard_N names. The one thing to confirm is that CI actually runs all four shards on Windows; if it only runs the base name, shards 1–3 would be dead weight. Worth a Windows CI check before merge.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
What
test_thread_local_destructorsrunsnmover every test executable in one CTest test, 100 files per call, one batch after another. It takes 30.8 s on the Windows CI runner (Windows job of run 45139610913, main151a77c837), over the 30 s that CONTRIBUTING.md allows, and it grows with every new test executable. Nearly all of the time is thenmphase: on a full build ofd32e214029with 3365 test executables,nmtook 21 s and theobjdumpphase found no file to disassemble.ThreadLocalDestructors.cmakenow takes optionalSHARDandSHARDSvalues. With them it sorts the matching files and checks everySHARDS-th one starting atSHARD, so the shards together check each file once; an out-of-rangeSHARDfails. Without them it checks all files, asprx_thread_local_destructorsandthread_local_destructors_unusable_nmstill do. The registration followsrebase_verify(#25461): the test keeps its name for shard 0, andtest_thread_local_destructors_shard_1to_3check the other files, each with the same 300 s timeout.tools/pr_overlap.py --branchcould not compare 13 open pull requests that conflict withmainand changecore/libs/CMakeLists.txt. I compared their diffs by hand: none changes athread_localtest registration, and no open pull request changesThreadLocalDestructors.cmake.Tested
Windows 11 Pro 10.0.26300, i7-8750H laptop, WinLibs GCC 15.2.0 r7, full build of
maind32e214029with this change applied.SHARD=4 SHARDS=4fails withSHARD must be from 0 to SHARDS - 1. The unsharded*.prxcheck still checks all 413 modules.ctest -N -R thread_local_destructorslists the four tests next toprx_thread_local_destructorsandthread_local_destructors_unusable_nm.ctest -R thread_local_destructors -j 4: all 6 pass; the shards took 13.1 to 19.5 s while running next to each other and toprx_thread_local_destructors.python tools/check_conventions.py --base origin/mainpasses. Not run on the CI runners; Linux and macOS do not register these tests.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code